home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_grenade.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  102 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_Grenade.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    activated
  14. message    touched
  15. message    taken
  16.  
  17. sound    foundOne=INXJ163.wav    local
  18. sound    foundPack=INXJ166.wav    local
  19.  
  20. thing    player                    local
  21.  
  22. int        bin=11                    local
  23.  
  24. int        bUnderwater                local
  25.  
  26. end
  27.  
  28. # ===================================================================
  29.  
  30. code
  31.  
  32. activated:
  33.  
  34.     player = GetSourceRef();
  35.  
  36.     StartCutscene(0);
  37.  
  38.     if (Rand() < 0.5)
  39.     {
  40.         SetExtCamOffset('0.15 -0.05 0.04');
  41.     }
  42.     else
  43.     {
  44.         SetExtCamOffset('-0.15 -0.05 0.04');
  45.     }
  46.     SetExtCamLookOffset('0.0 0.02 -0.01');
  47.  
  48.     return;
  49.  
  50. # -------------------------------------------------------------------
  51.  
  52. touched:
  53.  
  54.     player = GetSourceRef();
  55.  
  56.     if (GetInv(player, bin) < GetInvMax(player, bin))
  57.     {
  58.         TakeItem(GetSenderRef(), player);
  59.     }
  60.     else
  61.     {
  62.         EndCutscene();
  63.     }
  64.     
  65.     return;
  66.  
  67. # -------------------------------------------------------------------
  68.  
  69. taken:
  70.  
  71.     player = GetSourceRef();
  72.     bUnderwater = BitTest(GetThingFlags(player), 0x02000000);
  73.     
  74.     if (IsThingModelName(GetSenderRef(), "weap_grenade_pack.3do"))
  75.     {
  76.         JonesInvItemChanged(120);
  77.         ChangeInv(player, bin, 3);
  78.         SetInvAvailable(player, bin, 1);
  79.  
  80.         Sleep(1.0);
  81.  
  82.         if (!bUnderwater)
  83.             PlayVoice(player, foundPack, 1.0, 0);
  84.     }
  85.     else
  86.     {
  87.         JonesInvItemChanged(bin);
  88.         ChangeInv(player, bin, 1);
  89.         SetInvAvailable(player, bin, 1);
  90.     
  91.         Sleep(1.0);
  92.  
  93.         if (!bUnderwater)
  94.             PlayVoice(player, foundOne, 1.0, 0);
  95.     }
  96.  
  97.     EndCutscene();
  98.  
  99.     return;
  100.  
  101. end
  102.